home *** CD-ROM | disk | FTP | other *** search
- #ifndef _DCON_
- #define _DCON_
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
-
- #define DCON_ASSERTS 1
-
-
- void dprintf(char *env,char *format,...);
-
-
- #if DCON_ASSERTS
- #define dAssertPrint(condition) dprintf(NULL,"Assert failed: " condition " %s:%d\n",__FILE__,__LINE__)
- #define dAssertIfTrue(condition) ((condition) ? dAssertPrint(#condition) : ((void)0))
- #define dAssertIfFalse(condition) ((condition) ? ((void)0) : dAssertPrint(#condition))
- #define dAssert(condition) dAssertIfFalse(condition)
- #define if_dAssertIfTrue(condition) if ((condition) ? (dAssertPrint(#condition),true) : false)
- #define if_dAssertIfFalse(condition) if ((condition) ? true : (dAssertPrint(#condition),false))
- #else
- #define dAssertPrint(condition) ((void)0)
- #define dAssertIfTrue(condition) ((condition) ? ((void)0) : ((void)0))
- #define dAssertIfFalse(condition) ((condition) ? ((void)0) : ((void)0))
- #define dAssert(condition) dAssertIfFalse(condition)
- #define if_dAssertIfTrue(condition) if (condition)
- #define if_dAssertIfFalse(condition) if (condition)
- #endif
-
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* _DCON_ */
-